I want to create a dialog box which needs to use a structure similar to the objects in modules. I thought they were like listViews that each column is an attribute, but I realized there is no way to add richText/OLE in the listView (at least I could not figure out how to do that) strings. I believe DOORS was implemented in DXL so I am guessing there is a way to create a dialog box which will be similar to the modules. The problem I want to solve here is that I need to create a way to show a richText element that may contain OLE(For example, a picture) or richText tables.They might be too big(in width) for the richText DBE to show and when this happens I need a way to show the whole picture. When this kind of thing happens in objects the user can adjust the column slider until the column shows the whole DBE. I really need to create a dialog box with these features. Does anyone know how to do that? camba - Thu Jul 27 08:30:39 EDT 2017 |
Re: Which DBE was used to create object/modules? If you use constrained placement and stick the DBE to the sides then the richtext DBE should grow with the dialog. Could the user not simply maximize the Dialog so that the richTextDBE takes the whole width of the screen? Regards, Mathias |
Re: Which DBE was used to create object/modules? Mathias Mamsch - Thu Jul 27 11:10:13 EDT 2017 If you use constrained placement and stick the DBE to the sides then the richtext DBE should grow with the dialog. Could the user not simply maximize the Dialog so that the richTextDBE takes the whole width of the screen? Regards, Mathias This is a solution, but it would be preferable that this element does not take the whole size of the dialog box. In fact, this dialog box is quite complex and for its elements to be properly aligned I do need to fix some sizes manually, because sometimes DOORS creates minor asymmetries and my client is very concerned with layout design.
Isn't there really a way to create an element similar to the objects where the user can just adjust the column size for a richText element? |
Re: Which DBE was used to create object/modules? camba - Thu Jul 27 12:56:01 EDT 2017 This is a solution, but it would be preferable that this element does not take the whole size of the dialog box. In fact, this dialog box is quite complex and for its elements to be properly aligned I do need to fix some sizes manually, because sometimes DOORS creates minor asymmetries and my client is very concerned with layout design.
Isn't there really a way to create an element similar to the objects where the user can just adjust the column size for a richText element? There might be, but you don't want to go there. It is only possible with all sorts of hacks: - create a canvas, put a header column in there, set the resize callback - create a richTextDBE with right side unattached. Initialize to fixed size - on column resize of the header, calculate the difference between the old size and the new size. - Set the extraWidthShare of the richtext to grow with the dialog. - Store the old size of the dialog - Resize the dialog by the difference of the old size and the new size (this will make the richtext grow to the new size) - Set the extraWidthShare of the richtext to 0. Resize the dialog back to the original size. The richtext will have grown to the size of the column. Normally in DXL you will need to strip down your requirements regarding the GUI to a minimum. Try to find something simple that works for your use case. Explain your customer that DOORS cannot do any better and that you would produce even more weird behaviour if you tried to hack a layout. You could also do the GUI in java and have DXL communicate with it if you cared so much about GUIs. Maybe that helps, regards, Mathias NOTE: Here some hacked code, that shows you how weird hacked GUIs behave although they might seem to work
int backColor = colorYellow
DB menuDemo = create ("Sizing mess Demo", styleCentered|styleFixed)
void doClose(DB x) {
hide x
}
close(menuDemo, false, doClose)
void repaint(DBE c) {
background(c, backColor)
}
DBE canv = canvas(menuDemo, 300, 30, repaint)
canv->"top"->"form";
canv->"left"->"form";
canv->"right"->"form";
DBE r = richText(menuDemo, "","",100, 200, false);
r->"top"->"flush"->canv;
r->"left"->"form";
r->"right"->"unattached";
int oldSize = 100;
void cbs(DBE el, HeaderEvent headerEvent, int hIndex, int param) {
if (headerEvent == headerResize ) {
int difference = param - oldSize;
print "Resizing by difference " difference "\n";
int dbW, dbH;
getSize(menuDemo, dbW, dbH);
print "Current Size: " dbW "/" dbH "\n"
setExtraWidthShare(r, 1.0)
setSize(menuDemo, dbW+difference, dbH);
setExtraWidthShare(r, 0.0)
// setSize(menuDemo, dbW, dbH);
oldSize = param;
}
}
hasHeader(canv,cbs) ;
realize menuDemo
setExtraWidthShare(r, 0.0)
headerAddColumn(canv, "Test", 100)
headerShow(canv, true)
show menuDemo
|
Re: Which DBE was used to create object/modules? Mathias Mamsch - Thu Jul 27 16:30:56 EDT 2017 There might be, but you don't want to go there. It is only possible with all sorts of hacks: - create a canvas, put a header column in there, set the resize callback - create a richTextDBE with right side unattached. Initialize to fixed size - on column resize of the header, calculate the difference between the old size and the new size. - Set the extraWidthShare of the richtext to grow with the dialog. - Store the old size of the dialog - Resize the dialog by the difference of the old size and the new size (this will make the richtext grow to the new size) - Set the extraWidthShare of the richtext to 0. Resize the dialog back to the original size. The richtext will have grown to the size of the column. Normally in DXL you will need to strip down your requirements regarding the GUI to a minimum. Try to find something simple that works for your use case. Explain your customer that DOORS cannot do any better and that you would produce even more weird behaviour if you tried to hack a layout. You could also do the GUI in java and have DXL communicate with it if you cared so much about GUIs. Maybe that helps, regards, Mathias NOTE: Here some hacked code, that shows you how weird hacked GUIs behave although they might seem to work
int backColor = colorYellow
DB menuDemo = create ("Sizing mess Demo", styleCentered|styleFixed)
void doClose(DB x) {
hide x
}
close(menuDemo, false, doClose)
void repaint(DBE c) {
background(c, backColor)
}
DBE canv = canvas(menuDemo, 300, 30, repaint)
canv->"top"->"form";
canv->"left"->"form";
canv->"right"->"form";
DBE r = richText(menuDemo, "","",100, 200, false);
r->"top"->"flush"->canv;
r->"left"->"form";
r->"right"->"unattached";
int oldSize = 100;
void cbs(DBE el, HeaderEvent headerEvent, int hIndex, int param) {
if (headerEvent == headerResize ) {
int difference = param - oldSize;
print "Resizing by difference " difference "\n";
int dbW, dbH;
getSize(menuDemo, dbW, dbH);
print "Current Size: " dbW "/" dbH "\n"
setExtraWidthShare(r, 1.0)
setSize(menuDemo, dbW+difference, dbH);
setExtraWidthShare(r, 0.0)
// setSize(menuDemo, dbW, dbH);
oldSize = param;
}
}
hasHeader(canv,cbs) ;
realize menuDemo
setExtraWidthShare(r, 0.0)
headerAddColumn(canv, "Test", 100)
headerShow(canv, true)
show menuDemo
The dialog box element was just to show the "Object Text" of an object in a dialog box Is there a way to "select" a requirement and show it in its DOORS module? I have been trying to do it by using (current ObjectRef__) = desiredObject and the problem is that, althought the object is being showed in the module, the module stays behind my main dialog box(which is pretty big). Is there a way to force the module to be in front of the dialog box? |
Re: Which DBE was used to create object/modules?
that should be void raise (DB)
|
Re: Which DBE was used to create object/modules? oh, sorry. the other way round.
bringToFront
|
Re: Which DBE was used to create object/modules? Mike.Scharnow - Sat Aug 19 07:40:41 EDT 2017 oh, sorry. the other way round.
bringToFront
It does not seem to work when trying to do it from an activation callback in a treeView. Is there a workaround for this?
Edit: I got it working by using a menu in the treeView, but when I call the bringToFront function, the module gets resized and smaller than it was. Is there a way to set the module to be maximized?
Edit2: The answer to Edit is in https://www.ibm.com/developerworks/community/forums/html/topic?id=77777777-0000-0000-0000-000014311463&ps=25 |